package com.nwpu.coursesupport.mapper;

import com.nwpu.coursesupport.entity.TaskCourseTargetEntity;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 *
 *
 * @author shun
 * @email ws2017303035@mail.nwpu.edu.cn
 * @date 2020-08-04 21:33:50
 */
@Mapper
public interface TaskCourseTargetDao {

    @Insert("insert into task_course_target values (null,#{taskId},#{courseTargetId},#{weight},#{fullMark},#{actualMark})")
    void save(TaskCourseTargetEntity taskCourseTargetEntity);

    @Select("select * from task_course_target where task_id=#{taskId}")
    List<TaskCourseTargetEntity> findByTaskId(@Param("taskId") int taskId);

    @Delete("delete  from task_course_target where id=#{id}")
    void deleteById(@Param("id") Integer id);
}
